home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 710 < prev    next >
Internet Message Format  |  1996-08-06  |  907b

  1. Path: ip-pdx19-26.teleport.com!user
  2. From: peteski@teleport.com (Peter Miller)
  3. Newsgroups: comp.std.c
  4. Subject: Re: Is it legal to add 0 to NULL? What about NULL < NULL?
  5. Date: Mon, 08 Apr 1996 22:34:32 -0700
  6. Organization: Teleport - Portland's Public Access (503) 220-1016
  7. Message-ID: <peteski-0804962234320001@ip-pdx19-26.teleport.com>
  8. References: <ff1d.smail.smayo@tiac.net>
  9. NNTP-Posting-Host: ip-pdx19-26.teleport.com
  10.  
  11. In article <ff1d.smail.smayo@tiac.net>, smayo@tiac.net (Scott Mayo) wrote:
  12.  
  13. > I ask because a standard trick for walking an array A of size S is:
  14. > Thing *a = A;
  15. > Thing *fence = a + S;
  16. > but in my case, if S happens to be 0, a will start out NULL. This makes we
  17. > worry about both the value of fence
  18.  
  19. I don't think that is correct:
  20. If "a" is set to point to array A, then, after adding zero, it will still 
  21. point to array A (unless A was a pointer that happended to be NULL).
  22.  
  23. Peter
  24.